import { getUserInfoUrl } from "@/command/apiTool";
import { useDetail } from "@/hooks";
import { useRoute } from "vue-router";
export const useRequest = () => {
  const route = useRoute();
  const [detail] = useDetail(
    {
      url: "/api/H5/sell/showSale/getDetail",
      params: { id: route.query.id },
    },
    {
      img: "",
      title: "",
      sponsor: "",
      showTime: "",
      address: "",
      introduce: "",
    }
  );

  // 结队小户列表
  const [memberList] = useDetail(
    getUserInfoUrl({
      dh: "/api/H5/richCourse/large/getMemberList",
      xh: "",
    }),
    []
  );

  // 小户查询我的结队大户信息
  const [myTeamInfo] = useDetail(
    getUserInfoUrl({
      dh: "",
      xh: "/api/H5/richCourse/small/myTeamInfo",
    }),
    {
      userId: "",
      name: "",
      address: "",
      distance: "",
      entityComment: "",
      logoUrl: "",
      phone: "",
      title: "",
      workName: "",
      workDay: "",
      workPrice: "",
      userApplyVOList: [],
    }
  );

  return {
    detail,
    memberList,
    myTeamInfo,
  };
};
